package com.tank.jdk8.stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/2/12
 * Time: 21:02
 * To change this template use File | Settings | File Templates.
 */
public class StreamTest9 {

    public static void main(String[] args) {

        List<String> list = Arrays.asList("hello","你好");
        List<String> nameList = Arrays.asList("zhangsan","lisi","wangwu");

        list.stream().flatMap((item) ->   nameList.stream().map(itemName -> item+":"+itemName)).forEach(System.out::println);
        //打印结果
//        hello:zhangsan
//        hello:lisi
//        hello:wangwu
//        你好:zhangsan
//        你好:lisi
//        你好:wangwu
    }
}

